<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: contracts/eoslib/raw.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ae9b15dd87e066e1908bbd90e8f38627.html">contracts</a></li><li class="navelem"><a class="el" href="dir_3fea0bf1ce879ce73e6ecec98007efcd.html">eoslib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">raw.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="raw_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="types_8hpp.html">eoslib/types.hpp</a>&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="varint_8hpp.html">eoslib/varint.hpp</a>&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="datastream_8hpp.html">eoslib/datastream.hpp</a>&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="memory_8hpp.html">eoslib/memory.hpp</a>&gt;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="vector_8hpp.html">eoslib/vector.hpp</a>&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">eoslib/string.hpp</a>&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="reflect_8hpp.html">eoslib/reflect.hpp</a>&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeosio.html">eosio</a> {</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="namespaceeosio.html#a29af370d237fce6bc6bed2cb98bde53f">   15</a></span>&#160;   <span class="keyword">using</span> <a class="code" href="classeosio_1_1vector.html">bytes</a> = <a class="code" href="classeosio_1_1vector.html">vector&lt;char&gt;</a>;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html">   17</a></span>&#160;   <span class="keyword">namespace </span>raw {</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;   template&lt;typename Stream, typename T, typename reflector&lt;T&gt;::is_reflected::value = 1&gt;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">   20</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; ds, <span class="keyword">const</span> T&amp; t ) {</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;      <a class="code" href="structeosio_1_1reflector.html">reflector&lt;T&gt;::visit</a>( t, [&amp;]( <span class="keyword">const</span> <span class="keyword">auto</span>&amp; field ) {</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;         <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">raw::pack</a>( ds, field );</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;      });</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;   }</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;   template&lt;typename Stream, typename T, typename reflector&lt;T&gt;::is_reflected::value = 1&gt;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">   27</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; ds, T&amp; t ) {</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;      <a class="code" href="structeosio_1_1reflector.html">reflector&lt;T&gt;::visit</a>( t, [&amp;]( <span class="keyword">auto</span>&amp; field ) {</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;         <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">raw::unpack</a>( ds, field );</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;      });</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;   }</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream, <span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a112f69610dc8fc4dd47b7d6439909aaf">   51</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> T&amp; v ) {</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;      s &lt;&lt; v;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;   }</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;   </div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream, <span class="keyword">typename</span> T&gt; <span class="comment">//, typename reflector&lt;T&gt;::is_reflected::value = 0&gt;</span></div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a9560b54920d98f58ac6badd95bd0273b">   61</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, T&amp; v )</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;   {</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;      s &gt;&gt; v;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;   }</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;   </div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a6c76ae0ad08ada8453ae85da160717b2">   72</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <a class="code" href="structsigned__int.html">signed_int</a>&amp; v ) {</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;      <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> val = (v.<a class="code" href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">value</a>&lt;&lt;1) ^ (v.<a class="code" href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">value</a>&gt;&gt;31);</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;      <span class="keywordflow">do</span> {</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;         <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> b = <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>(val) &amp; 0x7f;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;         val &gt;&gt;= 7;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;         b |= ((val &gt; 0) &lt;&lt; 7);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;         s.write((<span class="keywordtype">char</span>*)&amp;b,1);<span class="comment">//.put(b);</span></div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;      } <span class="keywordflow">while</span>( val );</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;   }</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  </div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#af32fc84533a55db3f22ce2544c912500">   88</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <a class="code" href="structunsigned__int.html">unsigned_int</a>&amp; v ) {</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;      <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> val = v.<a class="code" href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">value</a>;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;      <span class="keywordflow">do</span> {</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;         <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> b = <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>(val) &amp; 0x7f;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;         val &gt;&gt;= 7;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;         b |= ((val &gt; 0) &lt;&lt; 7);</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;         s.write((<span class="keywordtype">char</span>*)&amp;b,1);<span class="comment">//.put(b);</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;      }<span class="keywordflow">while</span>( val );</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;   }</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#ab55ba0b9e1f8c70b8335b5062a1e745e">  104</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, <a class="code" href="structsigned__int.html">signed_int</a>&amp; vi ) {</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;      <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> v = 0; <span class="keywordtype">char</span> b = 0; <span class="keywordtype">int</span> by = 0;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;      <span class="keywordflow">do</span> {</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;         s.get(b);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;         v |= <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a>(<a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>(b) &amp; 0x7f) &lt;&lt; by;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;         by += 7;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;      } <span class="keywordflow">while</span>( <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>(b) &amp; 0x80 );</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;      vi.<a class="code" href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">value</a> = ((v&gt;&gt;1) ^ (v&gt;&gt;31)) + (v&amp;0x01);</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;      vi.<a class="code" href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">value</a> = v&amp;0x01 ? vi.<a class="code" href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">value</a> : -vi.<a class="code" href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">value</a>;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;      vi.<a class="code" href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">value</a> = -vi.<a class="code" href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">value</a>;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;   }</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a84114743979448c6cb3b43187043037b">  122</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, <a class="code" href="structunsigned__int.html">unsigned_int</a>&amp; vi ) {</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;      <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> v = 0; <span class="keywordtype">char</span> b = 0; <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> by = 0;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;      <span class="keywordflow">do</span> {</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;         s.get(b);</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;         v |= <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a>(<a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>(b) &amp; 0x7f) &lt;&lt; by;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;         by += 7;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;      } <span class="keywordflow">while</span>( <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>(b) &amp; 0x80 );</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;      vi.<a class="code" href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">value</a> = <span class="keyword">static_cast&lt;</span><a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a><span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;   }</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a87c7c7a0e7ac113a5f30186a0c4a843b">  138</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <a class="code" href="structpublic__key.html">public_key</a>&amp; value ) {</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;      s.write( (<span class="keywordtype">char</span> *)value.<a class="code" href="structpublic__key.html#ac8add9f1aa51fe78b3bb409215266bb4">data</a>, <span class="keyword">sizeof</span>(<a class="code" href="structpublic__key.html">public_key</a>) );</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;   }</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;   </div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a50db8fec4e5fabae9f92db46bbfb13ba">  148</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, <a class="code" href="structpublic__key.html">public_key</a>&amp; value ) {</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;      s.read( (<span class="keywordtype">char</span> *)value.<a class="code" href="structpublic__key.html#ac8add9f1aa51fe78b3bb409215266bb4">data</a>, <span class="keyword">sizeof</span>(<a class="code" href="structpublic__key.html">public_key</a>) );</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;   }</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a11f9e5cc56f6127f3da09b168e983c43">  158</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; v )  {</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;      <span class="keyword">auto</span> size = v.<a class="code" href="classeosio_1_1string.html#a7bc7a677ca79b2b3be0091e2d035f355">get_size</a>();</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, <a class="code" href="structunsigned__int.html">unsigned_int</a>(size));</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;      <span class="keywordflow">if</span>( size ) s.write( v.<a class="code" href="classeosio_1_1string.html#ab969d69b5af645bc30e2d4a602cb016e">get_data</a>(), size );</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;   }</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream, <span class="keyword">typename</span> T&gt; </div><div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a340ef64ff288397dfbda429e08ec092c">  170</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <a class="code" href="classeosio_1_1vector.html">vector&lt;T&gt;</a>&amp; v )  {</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;      <span class="keyword">auto</span> size = v.<a class="code" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">size</a>();</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, <a class="code" href="structunsigned__int.html">unsigned_int</a>(size));</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      <span class="keywordflow">for</span>( <span class="keyword">const</span> <span class="keyword">auto</span>&amp; value : v )</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;         <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, value );</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;   }</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream, <span class="keyword">typename</span> T&gt; </div><div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a02878c261d91b6acedc399b8a14f7f90">  178</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; ds, <a class="code" href="classeosio_1_1vector.html">vector&lt;T&gt;</a>&amp; v )  {</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;      <a class="code" href="structunsigned__int.html">unsigned_int</a> size; </div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( ds, size );</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;      v.<a class="code" href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">resize</a>(size);</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;      <span class="keywordflow">for</span>( <span class="keyword">auto</span>&amp; value : v )</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;         <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( ds, value );</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;   }</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a6f585b78072cdb8b635c6e9cbe9b5575">  192</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, <span class="keywordtype">string</span>&amp; v)  {</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;      <a class="code" href="structunsigned__int.html">unsigned_int</a> size; <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( s, size );</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;      v.<a class="code" href="classeosio_1_1string.html#aaed931c80e0dd8542e19b211f9dc7e73">assign</a>((<span class="keywordtype">char</span>*)s.pos(), size.<a class="code" href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">value</a>, <span class="keyword">true</span>);</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;      s.skip(size.<a class="code" href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">value</a>);</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;   }</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00204"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a07546e06f4ff3d5901e67ccfbf366187">  204</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <a class="code" href="structfixed__string32.html">fixed_string32</a>&amp; v )  {</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;      <span class="keyword">auto</span> size = v.<a class="code" href="structfixed__string32.html#a96c1e739f58582562c539d733d6f18b0">len</a>;</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, <a class="code" href="structunsigned__int.html">unsigned_int</a>(size));</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;      <span class="keywordflow">if</span>( size ) s.write( v.<a class="code" href="structfixed__string32.html#a7e091b3678b9e957f6d5ba42d443c217">str</a>, size );</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;   }</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#afe7f546e03a58b992377c2d386dc8574">  216</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, <a class="code" href="structfixed__string32.html">fixed_string32</a>&amp; v)  {</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;      <a class="code" href="structunsigned__int.html">unsigned_int</a> size; <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( s, size );</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;      <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>(size.<a class="code" href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">value</a> &lt;= 32, <span class="stringliteral">&quot;unpack fixed_string32&quot;</span>);</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;      s.read( (<span class="keywordtype">char</span> *)v.<a class="code" href="structfixed__string32.html#a7e091b3678b9e957f6d5ba42d443c217">str</a>, size );</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;      v.<a class="code" href="structfixed__string32.html#a96c1e739f58582562c539d733d6f18b0">len</a> = size;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;   }</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00229"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a78461ef509330322f50e6bb618a62258">  229</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <a class="code" href="structfixed__string16.html">fixed_string16</a>&amp; v )  {</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;      <span class="keyword">auto</span> size = v.<a class="code" href="structfixed__string16.html#a8eec9f81e469ac9108eac24ce0bd2c4c">len</a>;</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, <a class="code" href="structunsigned__int.html">unsigned_int</a>(size));</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;      <span class="keywordflow">if</span>( size ) s.write( v.<a class="code" href="structfixed__string16.html#af4fbeb30c27826fab71be2a81d11eaeb">str</a>, size );</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;   }</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a5940103ff3c90cff8a76b7cb29800223">  242</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, <a class="code" href="structfixed__string16.html">fixed_string16</a>&amp; v)  {</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;      <a class="code" href="structunsigned__int.html">unsigned_int</a> size; <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( s, size );</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;      <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>(size.<a class="code" href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">value</a> &lt;= 16, <span class="stringliteral">&quot;unpack fixed_string16&quot;</span>);</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;      s.read( (<span class="keywordtype">char</span> *)v.<a class="code" href="structfixed__string16.html#af4fbeb30c27826fab71be2a81d11eaeb">str</a>, size );</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;      v.<a class="code" href="structfixed__string16.html#a8eec9f81e469ac9108eac24ce0bd2c4c">len</a> = size;</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;   }</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;  </div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt;</div><div class="line"><a name="l00250"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a82beb30f7ed6d83320ea50d144331cb5">  250</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>(Stream &amp;s, const ::account_permission &amp;pe) {</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>(s, pe.account);</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>(s, pe.permission);</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;   }</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#ad4ea59b5af102a483d07a5c364aa3aef">  256</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>(Stream &amp;s, ::<a class="code" href="structaccount__permission.html">account_permission</a> &amp;pe) {</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>(s, pe.<a class="code" href="structaccount__permission.html#ad27c2a755c671a1fed5a5f36400597a7">account</a>);</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>(s, pe.<a class="code" href="structaccount__permission.html#a325949ab97fd287558359b7314d22088">permission</a>);</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;   }</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00266"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#aebf5859aafc5b9f81fa16b63ed42aec6">  266</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <span class="keywordtype">bool</span>&amp; v ) { </div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;       <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>(v) );</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;   }</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream, <span class="keyword">typename</span> T&gt; </div><div class="line"><a name="l00277"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a1f6eecb006a4a8d196a128f47819b63e">  277</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> T* varr, <span class="keywordtype">size_t</span> count ) {</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, <a class="code" href="structunsigned__int.html">unsigned_int</a>(count) );</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;      <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> idx = 0; idx &lt; count; idx++) {</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;         <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, varr[idx] );</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;      }</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;   }</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream, <span class="keyword">typename</span> T&gt; </div><div class="line"><a name="l00285"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a4e3528fb91dc77358b9dfa94488211fe">  285</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, T* varr, <span class="keywordtype">size_t</span> &amp;count, <span class="keywordtype">size_t</span> max_count ) {</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;      <a class="code" href="structunsigned__int.html">unsigned_int</a> packed_count;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( s, packed_count );</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;      count = packed_count.<a class="code" href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">value</a>;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;      <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>(count &lt;= max_count, <span class="stringliteral">&quot;array too large to read&quot;</span>);</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;      <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> idx = 0; idx &lt; count; idx++) {</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;         <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( s, varr[idx] );</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;      }</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;   }</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00298"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a11cb525e4a5ae62c6b8d2988bae7e2a6">  298</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( Stream&amp; s, <span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keywordtype">size_t</span> len ) {</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;     <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>( s, <a class="code" href="structunsigned__int.html">unsigned_int</a>(len) );</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;     <span class="keywordflow">if</span>( len )</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        s.write( str, len );</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;   }</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00305"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a1244084628631eae02ccff403db40044">  305</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, <span class="keywordtype">char</span> *str, <span class="keywordtype">size_t</span> &amp;len, <span class="keywordtype">size_t</span> max_len ) {</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;      <a class="code" href="structunsigned__int.html">unsigned_int</a> packed_len;</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( s, packed_len );</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;      len = packed_len.<a class="code" href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">value</a>;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;      <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>(len &lt;= max_len, <span class="stringliteral">&quot;raw string too large to read&quot;</span>);</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;      <span class="keywordflow">if</span>( len )</div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;         s.read( str, len );</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;   }</div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Stream&gt; </div><div class="line"><a name="l00320"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#af81ed97e8ca56f037635cd057c357e02">  320</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( Stream&amp; s, <span class="keywordtype">bool</span>&amp; v )</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;   {</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;      <a class="code" href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> b;</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>( s, b );</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;      <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( (b &amp; ~1) == 0, <span class="stringliteral">&quot;unpack bool&quot;</span> );</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;      v=(b!=0);</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;   }</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;  </div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00333"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#ade628b6c0aa3341fa50e77bbf96cf256">  333</a></span>&#160;   <span class="keywordtype">size_t</span> <a class="code" href="namespaceeosio_1_1raw.html#ade628b6c0aa3341fa50e77bbf96cf256">pack_size</a>( <span class="keyword">const</span> T&amp; v )</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;   {</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;      <a class="code" href="classeosio_1_1datastream_3_01size__t_01_4.html">datastream&lt;size_t&gt;</a> ps;</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>(ps,v );</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;      <span class="keywordflow">return</span> ps.<a class="code" href="classeosio_1_1datastream_3_01size__t_01_4.html#aadcdabf95d8b142bd9b43bbcdc4e0d9f">tellp</a>();</div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;   }</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;  </div><div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00345"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a8f45f5a5ccd12f6864cedcb972b4248f">  345</a></span>&#160;   <a class="code" href="classeosio_1_1vector.html">bytes</a> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>(  <span class="keyword">const</span> T&amp; v ) {</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;      <a class="code" href="classeosio_1_1datastream_3_01size__t_01_4.html">datastream&lt;size_t&gt;</a> ps;</div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>(ps, v);</div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;      <span class="keyword">const</span> <span class="keyword">auto</span> size = ps.<a class="code" href="classeosio_1_1datastream_3_01size__t_01_4.html#aadcdabf95d8b142bd9b43bbcdc4e0d9f">tellp</a>();</div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;      <a class="code" href="classeosio_1_1vector.html">bytes</a> b;</div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;</div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;      <span class="keywordflow">if</span>( size ) {</div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;         b.<a class="code" href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">resize</a>(ps.<a class="code" href="classeosio_1_1datastream_3_01size__t_01_4.html#aadcdabf95d8b142bd9b43bbcdc4e0d9f">tellp</a>());</div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;         <a class="code" href="classeosio_1_1datastream.html">datastream&lt;char*&gt;</a>  ds( b.<a class="code" href="classeosio_1_1vector.html#a507aa9b38f52df26d8b740cc30379a08">data</a>(), b.<a class="code" href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">size</a>() );</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;         <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>(ds,v);</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;      }</div><div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;      <span class="keywordflow">return</span> b;</div><div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;   }</div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00365"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a933848a437010e984bd1b0359fd7248a">  365</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">pack</a>( <span class="keywordtype">char</span>* d, <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> s, <span class="keyword">const</span> T&amp; v ) {</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;      <a class="code" href="classeosio_1_1datastream.html">datastream&lt;char*&gt;</a> ds(d,s);</div><div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a>(ds,v );</div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;   }</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;</div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00376"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#a5705c87620a0a6341c3ae665ee02dc0e">  376</a></span>&#160;   T <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* d, <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> s )</div><div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;   {</div><div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;      T v;</div><div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;      <a class="code" href="classeosio_1_1datastream.html">datastream&lt;const char*&gt;</a>  ds( d, s );</div><div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>(ds,v);</div><div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;      <span class="keywordflow">return</span> v;</div><div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;   }</div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;  </div><div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00390"></a><span class="lineno"><a class="line" href="namespaceeosio_1_1raw.html#aa30742e7f255d7d8c640f727855e90d9">  390</a></span>&#160;   <span class="keywordtype">void</span> <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">unpack</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* d, <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> s, T&amp; v )</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;   {</div><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;      <a class="code" href="classeosio_1_1datastream.html">datastream&lt;const char*&gt;</a>  ds( d, s );</div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;      <a class="code" href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a>(ds,v);</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;   }</div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;} } <span class="comment">// namespace eosio::raw</span></div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;</div><div class="ttc" id="group__types_html_gaba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="group__types.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> types.h:21</div></div>
<div class="ttc" id="classeosio_1_1datastream_3_01size__t_01_4_html_aadcdabf95d8b142bd9b43bbcdc4e0d9f"><div class="ttname"><a href="classeosio_1_1datastream_3_01size__t_01_4.html#aadcdabf95d8b142bd9b43bbcdc4e0d9f">eosio::datastream&lt; size_t &gt;::tellp</a></div><div class="ttdeci">size_t tellp() const</div><div class="ttdef"><b>Definition:</b> datastream.hpp:124</div></div>
<div class="ttc" id="namespaceeosio_html"><div class="ttname"><a href="namespaceeosio.html">eosio</a></div><div class="ttdoc">Used to forward declare raw functions. </div><div class="ttdef"><b>Definition:</b> account.hpp:12</div></div>
<div class="ttc" id="classeosio_1_1string_html_ab969d69b5af645bc30e2d4a602cb016e"><div class="ttname"><a href="classeosio_1_1string.html#ab969d69b5af645bc30e2d4a602cb016e">eosio::string::get_data</a></div><div class="ttdeci">const char * get_data() const</div><div class="ttdef"><b>Definition:</b> string.hpp:135</div></div>
<div class="ttc" id="group__systemcapi_html_gae2a6ebaf48fe7c69f847ae18f109d09a"><div class="ttname"><a href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a></div><div class="ttdeci">void assert(uint32_t test, const char *cstr)</div><div class="ttdoc">Aborts processing of this action and unwinds all pending changes. </div></div>
<div class="ttc" id="structaccount__permission_html_ad27c2a755c671a1fed5a5f36400597a7"><div class="ttname"><a href="structaccount__permission.html#ad27c2a755c671a1fed5a5f36400597a7">account_permission::account</a></div><div class="ttdeci">account_name account</div><div class="ttdef"><b>Definition:</b> types.h:76</div></div>
<div class="ttc" id="structeosio_1_1reflector_html"><div class="ttname"><a href="structeosio_1_1reflector.html">eosio::reflector</a></div><div class="ttdef"><b>Definition:</b> reflect.hpp:11</div></div>
<div class="ttc" id="namespaceeosio_1_1raw_html_ade628b6c0aa3341fa50e77bbf96cf256"><div class="ttname"><a href="namespaceeosio_1_1raw.html#ade628b6c0aa3341fa50e77bbf96cf256">eosio::raw::pack_size</a></div><div class="ttdeci">size_t pack_size(const T &amp;v)</div><div class="ttdef"><b>Definition:</b> raw.hpp:333</div></div>
<div class="ttc" id="structunsigned__int_html_a247200b83e3cb2019efb8569a7e3937a"><div class="ttname"><a href="structunsigned__int.html#a247200b83e3cb2019efb8569a7e3937a">unsigned_int::value</a></div><div class="ttdeci">uint32_t value</div><div class="ttdef"><b>Definition:</b> varint.hpp:28</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a857bf0bac13794f1df2f5d25b5b5d5a8"><div class="ttname"><a href="classeosio_1_1vector.html#a857bf0bac13794f1df2f5d25b5b5d5a8">eosio::vector::size</a></div><div class="ttdeci">uint32_t size() const</div><div class="ttdef"><b>Definition:</b> vector.hpp:92</div></div>
<div class="ttc" id="group__types_html_gaaa5d1cd013383c889537491c3cfd9aad"><div class="ttname"><a href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a></div><div class="ttdeci">unsigned long long uint64_t</div><div class="ttdef"><b>Definition:</b> types.h:18</div></div>
<div class="ttc" id="reflect_8hpp_html"><div class="ttname"><a href="reflect_8hpp.html">reflect.hpp</a></div></div>
<div class="ttc" id="namespaceeosio_1_1raw_html_a57bce67f0c5a31a944d454b8e6eda4b8"><div class="ttname"><a href="namespaceeosio_1_1raw.html#a57bce67f0c5a31a944d454b8e6eda4b8">eosio::raw::pack</a></div><div class="ttdeci">void pack(Stream &amp;ds, const T &amp;t)</div><div class="ttdef"><b>Definition:</b> raw.hpp:20</div></div>
<div class="ttc" id="types_8hpp_html"><div class="ttname"><a href="types_8hpp.html">types.hpp</a></div></div>
<div class="ttc" id="structfixed__string16_html_af4fbeb30c27826fab71be2a81d11eaeb"><div class="ttname"><a href="structfixed__string16.html#af4fbeb30c27826fab71be2a81d11eaeb">fixed_string16::str</a></div><div class="ttdeci">char str[16]</div><div class="ttdef"><b>Definition:</b> types.h:63</div></div>
<div class="ttc" id="structsigned__int_html"><div class="ttname"><a href="structsigned__int.html">signed_int</a></div><div class="ttdoc">serializes a 32 bit signed integer in as few bytes as possible </div><div class="ttdef"><b>Definition:</b> varint.hpp:75</div></div>
<div class="ttc" id="structpublic__key_html_ac8add9f1aa51fe78b3bb409215266bb4"><div class="ttname"><a href="structpublic__key.html#ac8add9f1aa51fe78b3bb409215266bb4">public_key::data</a></div><div class="ttdeci">uint8_t data[33]</div><div class="ttdef"><b>Definition:</b> types.h:50</div></div>
<div class="ttc" id="datastream_8hpp_html"><div class="ttname"><a href="datastream_8hpp.html">datastream.hpp</a></div></div>
<div class="ttc" id="structunsigned__int_html"><div class="ttname"><a href="structunsigned__int.html">unsigned_int</a></div><div class="ttdef"><b>Definition:</b> varint.hpp:14</div></div>
<div class="ttc" id="group__types_html_ga06896e8c53f721507066c079052171f8"><div class="ttname"><a href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a></div><div class="ttdeci">unsigned long uint32_t</div><div class="ttdef"><b>Definition:</b> types.h:19</div></div>
<div class="ttc" id="classeosio_1_1string_html_a7bc7a677ca79b2b3be0091e2d035f355"><div class="ttname"><a href="classeosio_1_1string.html#a7bc7a677ca79b2b3be0091e2d035f355">eosio::string::get_size</a></div><div class="ttdeci">const size_t get_size() const</div><div class="ttdef"><b>Definition:</b> string.hpp:130</div></div>
<div class="ttc" id="structfixed__string16_html_a8eec9f81e469ac9108eac24ce0bd2c4c"><div class="ttname"><a href="structfixed__string16.html#a8eec9f81e469ac9108eac24ce0bd2c4c">fixed_string16::len</a></div><div class="ttdeci">uint8_t len</div><div class="ttdef"><b>Definition:</b> types.h:62</div></div>
<div class="ttc" id="structfixed__string16_html"><div class="ttname"><a href="structfixed__string16.html">fixed_string16</a></div><div class="ttdef"><b>Definition:</b> types.h:61</div></div>
<div class="ttc" id="structpublic__key_html"><div class="ttname"><a href="structpublic__key.html">public_key</a></div><div class="ttdef"><b>Definition:</b> types.h:49</div></div>
<div class="ttc" id="structfixed__string32_html_a96c1e739f58582562c539d733d6f18b0"><div class="ttname"><a href="structfixed__string32.html#a96c1e739f58582562c539d733d6f18b0">fixed_string32::len</a></div><div class="ttdeci">uint8_t len</div><div class="ttdef"><b>Definition:</b> types.h:69</div></div>
<div class="ttc" id="classeosio_1_1vector_html_a507aa9b38f52df26d8b740cc30379a08"><div class="ttname"><a href="classeosio_1_1vector.html#a507aa9b38f52df26d8b740cc30379a08">eosio::vector::data</a></div><div class="ttdeci">const T * data() const</div><div class="ttdef"><b>Definition:</b> vector.hpp:90</div></div>
<div class="ttc" id="string_8hpp_html"><div class="ttname"><a href="string_8hpp.html">string.hpp</a></div></div>
<div class="ttc" id="structaccount__permission_html_a325949ab97fd287558359b7314d22088"><div class="ttname"><a href="structaccount__permission.html#a325949ab97fd287558359b7314d22088">account_permission::permission</a></div><div class="ttdeci">permission_name permission</div><div class="ttdef"><b>Definition:</b> types.h:77</div></div>
<div class="ttc" id="classeosio_1_1vector_html"><div class="ttname"><a href="classeosio_1_1vector.html">eosio::vector&lt; char &gt;</a></div></div>
<div class="ttc" id="structfixed__string32_html_a7e091b3678b9e957f6d5ba42d443c217"><div class="ttname"><a href="structfixed__string32.html#a7e091b3678b9e957f6d5ba42d443c217">fixed_string32::str</a></div><div class="ttdeci">char str[32]</div><div class="ttdef"><b>Definition:</b> types.h:70</div></div>
<div class="ttc" id="vector_8hpp_html"><div class="ttname"><a href="vector_8hpp.html">vector.hpp</a></div></div>
<div class="ttc" id="structfixed__string32_html"><div class="ttname"><a href="structfixed__string32.html">fixed_string32</a></div><div class="ttdef"><b>Definition:</b> types.h:68</div></div>
<div class="ttc" id="structaccount__permission_html"><div class="ttname"><a href="structaccount__permission.html">account_permission</a></div><div class="ttdef"><b>Definition:</b> types.h:75</div></div>
<div class="ttc" id="classeosio_1_1datastream_html"><div class="ttname"><a href="classeosio_1_1datastream.html">eosio::datastream</a></div><div class="ttdoc">A data stream for reading and writing data in the form of bytes. </div><div class="ttdef"><b>Definition:</b> datastream.hpp:14</div></div>
<div class="ttc" id="classeosio_1_1string_html_aaed931c80e0dd8542e19b211f9dc7e73"><div class="ttname"><a href="classeosio_1_1string.html#aaed931c80e0dd8542e19b211f9dc7e73">eosio::string::assign</a></div><div class="ttdeci">string &amp; assign(char *d, size_t s, bool copy)</div><div class="ttdef"><b>Definition:</b> string.hpp:159</div></div>
<div class="ttc" id="structsigned__int_html_aa943a3c55006fb2cc4e88afd6edc1755"><div class="ttname"><a href="structsigned__int.html#aa943a3c55006fb2cc4e88afd6edc1755">signed_int::value</a></div><div class="ttdeci">int32_t value</div><div class="ttdef"><b>Definition:</b> varint.hpp:83</div></div>
<div class="ttc" id="varint_8hpp_html"><div class="ttname"><a href="varint_8hpp.html">varint.hpp</a></div></div>
<div class="ttc" id="classeosio_1_1datastream_3_01size__t_01_4_html"><div class="ttname"><a href="classeosio_1_1datastream_3_01size__t_01_4.html">eosio::datastream&lt; size_t &gt;</a></div><div class="ttdoc">Specialization of datastream used to help determine the final size of a serialized value...</div><div class="ttdef"><b>Definition:</b> datastream.hpp:116</div></div>
<div class="ttc" id="memory_8hpp_html"><div class="ttname"><a href="memory_8hpp.html">memory.hpp</a></div></div>
<div class="ttc" id="classeosio_1_1vector_html_a3028d9696b8e9e043d48c1985b5a228a"><div class="ttname"><a href="classeosio_1_1vector.html#a3028d9696b8e9e043d48c1985b5a228a">eosio::vector::resize</a></div><div class="ttdeci">void resize(uint32_t new_size)</div><div class="ttdef"><b>Definition:</b> vector.hpp:110</div></div>
<div class="ttc" id="namespaceeosio_1_1raw_html_ab1d3be0baf9bbbf0977000e24a3bec92"><div class="ttname"><a href="namespaceeosio_1_1raw.html#ab1d3be0baf9bbbf0977000e24a3bec92">eosio::raw::unpack</a></div><div class="ttdeci">void unpack(Stream &amp;ds, T &amp;t)</div><div class="ttdef"><b>Definition:</b> raw.hpp:27</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
